#include<bits/stdc++.h>
using namespace std;
#define int long long
vector<int> vec;
void pop_back()
{

}
void push_back()
{

}
void push_front()
{

}
void pop_back()
{

}
signed main()
{
	int n;
	cin >> n;
	while (n --) {
		string s;
		cin >> s;
		int x;
		if (s == "pop_back") {
			cin >> x;
			pop_back(x);
		} else if (s == "push_back") {
			int y;
			cin >> y;
			push_back(x,y);
		} else if (s == "push_front") {
			int x;
			cin >> x;
			push_front(x);
		} else if (s == "pop_back") {
			pop_back();
		} else if (s == "size") {
			size();
		} else if (s == "front") {
			front();
		} else if (s == "back") {
			back();
		}
	}
	return 0;
}
